<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>自定义菜单配置</title>
<script language="javascript" src="js/jquery.js"></script>
<script language="javascript" src="js/admin_common.js"></script>
<link href="static/admin/css/css_menu.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<body width="60%">
.alert {
    padding: 5px 5px 5px 5px;
    text-shadow: none;
    background-color: #F9EDBE;
    border: 1px solid #F0C36D;
    border-radius: 2px;
    color: #333;
    margin-top: 5px;
}
.tb1 td{border-bottom:1px solid #e5e5e5; border-collapse:collapse; height:30px;}
</style>
</head>

<body width="60%">
<div class="body" width="60%">

<div class="right">
<div class="nav"><a href="admin.php?m=wxmenu">微信自定义菜单配置</a></div>
<!-- <div class="alert" style=" margin-bottom:10px">
  <p><span class="bold">提示：</span>设置关键字点击菜单进入文字回复和图文回复，设置url点击菜单直接跳转页面，url为http开头的链接</p>
</div> -->
<!-- <div style="margin:20px 20px 20px; font-size:16px"><a href="admin.php?m=wxmenu">设置关键字点击菜单进入文字回复和图文回复，设置url点击菜单直接跳转页面，url为http开头的链接</a></div> -->
<div class="rbox">
<form action="admin.php?m=wxmenu&a=add_db" name="f1" method="post">
<table border="0" align="center" cellpadding="0" cellspacing="1" class="tb1"> 
    <tr>
<td>微信&nbsp;AppId:<input name="appid" id="appid" value="{$rs.appid}" class="px" tabindex="1" size="40" type="text"> 微信&nbsp;AppSecret:<input name="appsecret" value="{$rs.appsecret}" class="px" tabindex="1" size="40" type="text"></td>
      <!-- <td height="25" align="right">AppId：&nbsp;&nbsp;<input name="appid" type="text" id="appid" value="{$rs.appid}" size="30" />
      <i height="25" align="right">AppSecret：&nbsp;&nbsp;<input name="appsecret" type="text" id="appsecret" value="{$rs.appsecret}" size="40" /></i>
    </td>
    </tr> -->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tb1">
  <tr>
    <td width="120" height="30" align="center"></td>
    <td width="145" align="center">菜单名称</td>
    <td width="145" align="center">菜单类型</td>
    <td width="400" align="center">填入关键词或需跳转的链接</td>
  </tr>
  <tr>
    <td style=" background-color: #5aa439" ;><center><span style="color:#fff;">左侧主菜单</span></center>
    </td>
    <td><input name="menu1name" type="text" id="menu1name" value="{$rs.menu1name}" size="20" />
    </td>
    <td>
    <select name="menu1type">
    {foreach item=t from=$menuTypeList}
    <option value="{$t.key}" {if $t.key eq $rs.menu1type}selected{/if}>{$t.value}</option>
    {/foreach}
    </select>
    </td>
    <td><input name="menu1key" type="text" id="menu1key" value="{$rs.menu1key}" size="30" /><span class="bold">注意：</span>此项仅在未配置子菜单的情况下才需填写</td>
  </tr>
  <tr>
      <td height="25" align="right">子菜单1：</td>
      <td><input name="menu1submenu1name" type="text" id="menu1submenu1name" value="{$rs.menu1submenu1name}" size="20" />
      <td>
	    <select name="menu1submenu1type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu1submenu1type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
      <td><input name="menu1submenu1key" type="text" id="menu1submenu1key" value="{$rs.menu1submenu1key}" size="70" " />
  </td>
  <tr>
      <td height="25" align="right">子菜单2：</td>
        <td><input name="menu1submenu2name" type="text" id="menu1submenu2name" value="{$rs.menu1submenu2name}" size="20" />
      <td>
	    <select name="menu1submenu2type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu1submenu2type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu1submenu2key" type="text" id="menu1submenu2key" value="{$rs.menu1submenu2key}" size="70" />
  </td>
  <tr>
      <td height="25" align="right">子菜单3：</td>
        <td><input name="menu1submenu3name" type="text" id="menu1submenu3name" value="{$rs.menu1submenu3name}" size="20" />
      <td>
	    <select name="menu1submenu3type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu1submenu3type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu1submenu3key" type="text" id="menu1submenu3key" value="{$rs.menu1submenu3key}" size="70" />
  </td>
  <tr>
      <td height="25" align="right">子菜单4：</td>
        <td><input name="menu1submenu4name" type="text" id="menu1submenu4name" value="{$rs.menu1submenu4name}" size="20" />
      <td>
	    <select name="menu1submenu4type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu1submenu4type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu1submenu4key" type="text" id="menu1submenu4key" value="{$rs.menu1submenu4key}" size="70" />
  </td>
  <tr>
      <td height="25" align="right">子菜单5：</td>
        <td><input name="menu1submenu5name" type="text" id="menu1submenu5name" value="{$rs.menu1submenu5name}" size="20" />
      <td>
	    <select name="menu1submenu5type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu1submenu5type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu1submenu5key" type="text" id="menu1submenu5key" value="{$rs.menu1submenu5key}" size="70" />
  </td>
  </td>
  </tr>

  <tr>
    <td style=" background-color: #5aa439";><center><span style="color:#fff;">中部主菜单</span></center>
    </td>
    <td><input name="menu2name" type="text" id="menu2name" value="{$rs.menu2name}" size="20" /></td>
      <td>
	    <select name="menu2type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu2type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
    <td><input name="menu2key" type="text" id="menu2key" value="{$rs.menu2key}" size="30" /><span class="bold">注意：</span>此项仅在未配置子菜单的情况下才需填写</td>
<!--     <td>
      <div class="alert"><p><span class="bold">注意：</span>此项仅在未配置子菜单的情况下才需填写</p>
      </div> -->
    </td>
  </tr>
    <tr>
      <td height="25" align="right">子菜单1：</td>
        <td><input name="menu2submenu1name" type="text" id="menu2submenu1name" value="{$rs.menu2submenu1name}" size="20" />
      <td>
	    <select name="menu2submenu1type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu2submenu1type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu2submenu1key" type="text" id="menu2submenu1key" value="{$rs.menu2submenu1key}" size="70" />
  </td>
  <tr>
      <td height="25" align="right">子菜单2：</td>
        <td><input name="menu2submenu2name" type="text" id="menu2submenu2name" value="{$rs.menu2submenu2name}" size="20" />
      <td>
	    <select name="menu2submenu2type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu2submenu2type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu2submenu2key" type="text" id="menu2submenu2key" value="{$rs.menu2submenu2key}" size="70" />
  </td>
  <tr>
      <td height="25" align="right">子菜单3：</td>
        <td><input name="menu2submenu3name" type="text" id="menu2submenu3name" value="{$rs.menu2submenu3name}" size="20" />
      <td>
	    <select name="menu2submenu3type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu2submenu3type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu2submenu3key" type="text" id="menu2submenu3key" value="{$rs.menu2submenu3key}" size="70" />
  </td>
  <tr>
      <td height="25" align="right">子菜单4：</td>
        <td><input name="menu2submenu4name" type="text" id="menu2submenu4name" value="{$rs.menu2submenu4name}" size="20" />
      <td>
	    <select name="menu2submenu4type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu2submenu4type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu2submenu4key" type="text" id="menu2submenu4key" value="{$rs.menu2submenu4key}" size="70" />
  </td>
  <tr>
      <td height="25" align="right">子菜单5：</td>
        <td><input name="menu2submenu5name" type="text" id="menu2submenu5name" value="{$rs.menu2submenu5name}" size="20" />
      <td>
	    <select name="menu2submenu5type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu2submenu5type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu2submenu5key" type="text" id="menu2submenu5key" value="{$rs.menu2submenu5key}" size="70" />
  </td>

  <tr>
    <td style=" background-color: #5aa439";><center><span style="color:#fff;">右侧主菜单</span></center>
    </td>
    <td><input name="menu3name" type="text" id="menu3name" value="{$rs.menu3name}" size="20" /></td>
      <td>
	    <select name="menu3type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu3type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
    <td><input name="menu3key" type="text" id="menu3key" value="{$rs.menu3key}" size="30" /><span class="bold">注意：</span>此项仅在未配置子菜单的情况下才需填写</td>
<!--     <td>
      <div class="alert" "><p><span class="bold">注意：</span>此项仅在未配置子菜单的情况下才需填写</p>
      </div>
    </td> -->
  </tr>
    <tr>
      <tr>
      <td height="25" align="right">子菜单1：</td>
        <td><input name="menu3submenu1name" type="text" id="menu3submenu1name" value="{$rs.menu3submenu1name}" size="20" />
      <td>
	    <select name="menu3submenu1type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu3submenu1type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu3submenu1key" type="text" id="menu3submenu1key" value="{$rs.menu3submenu1key}" size="70" />
  </td>
  <tr>
      <td height="25" align="right">子菜单2：</td>
        <td><input name="menu3submenu2name" type="text" id="menu3submenu2name" value="{$rs.menu3submenu2name}" size="20" />
      <td>
	    <select name="menu3submenu2type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu3submenu2type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu3submenu2key" type="text" id="menu3submenu2key" value="{$rs.menu3submenu2key}" size="70" />
  </td>
  <tr>
      <td height="25" align="right">子菜单3：</td>
        <td><input name="menu3submenu3name" type="text" id="menu3submenu3name" value="{$rs.menu3submenu3name}" size="20" />
      <td>
	    <select name="menu3submenu3type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu3submenu3type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu3submenu3key" type="text" id="menu3submenu3key" value="{$rs.menu3submenu3key}" size="70" />
  </td>
  <tr>
      <td height="25" align="right">子菜单4：</td>
        <td><input name="menu3submenu4name" type="text" id="menu3submenu4name" value="{$rs.menu3submenu4name}" size="20" />
      <td>
	    <select name="menu3submenu4type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu3submenu4type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu3submenu4key" type="text" id="menu3submenu4key" value="{$rs.menu3submenu4key}" size="70" />
  </td>
  <tr>
      <td height="25" align="right">子菜单5：</td>
        <td><input name="menu3submenu5name" type="text" id="menu3submenu5name" value="{$rs.menu3submenu5name}" size="20" />
      <td>
	    <select name="menu3submenu5type">
	    {foreach item=t from=$menuTypeList}
	    <option value="{$t.key}" {if $t.key eq $rs.menu3submenu5type}selected{/if}>{$t.value}</option>
	    {/foreach}
	    </select>
	  </td>
        <td><input name="menu3submenu5key" type="text" id="menu3submenu5key" value="{$rs.menu3submenu5key}" size="70" />
  </td>
<!--   <tr>
      <td height="25" align="right">&nbsp;&nbsp;子菜单菜单1：</td>
    <td>菜单名<input name="menu3submenu1name" type="text" id="menu3submenu1name" value="{$rs.menu3submenu1name}" size="30" />&nbsp;&nbsp;关键字/url<input name="menu3submenu1key" type="text" id="menu3submenu1key" value="{$rs.menu3submenu1key}" size="30" /></td>
  </tr>
  <tr>
    <td height="25" align="right">&nbsp;&nbsp;子菜单菜单2：</td>
    <td>菜单名<input name="menu3submenu2name" type="text" id="menu3submenu2name" value="{$rs.menu3submenu2name}" size="30" />&nbsp;&nbsp;关键字/url<input name="menu3submenu2key" type="text" id="menu3submenu2key" value="{$rs.menu3submenu2key}" size="30" /></td>
  </tr>
  <tr>
    <td height="25" align="right">&nbsp;&nbsp;子菜单菜单3：</td>
    <td>菜单名<input name="menu3submenu3name" type="text" id="menu3submenu3name" value="{$rs.menu3submenu3name}" size="30" />&nbsp;&nbsp;关键字/url<input name="menu3submenu3key" type="text" id="menu3submenu3key" value="{$rs.menu3submenu3key}" size="30" /></td>
  </tr>
  <tr>
    <td height="25" align="right">&nbsp;&nbsp;子菜单菜单4：</td>
    <td>菜单名<input name="menu3submenu4name" type="text" id="menu3submenu4name" value="{$rs.menu3submenu4name}" size="30" />&nbsp;&nbsp;关键字/url<input name="menu3submenu4key" type="text" id="menu3submenu4key" value="{$rs.menu3submenu4key}" size="30" /></td>
  </tr>
  <tr>
    <td height="25" align="right">&nbsp;&nbsp;子菜单菜单5：</td>
    <td>菜单名<input name="menu3submenu5name" type="text" id="menu3submenu5name" value="{$rs.menu3submenu5name}" size="30" />&nbsp;&nbsp;关键字/url<input name="menu3submenu5key" type="text" id="menu3submenu5key" value="{$rs.menu3submenu5key}" size="30" /></td>
  </tr>
  <tr> -->
  </tr>
<td height="35" align="right">&nbsp;</td>
<td><input type="submit" name="button" id="button" value="确认" class="btn3"/></td>
</tr>
</table>

</form>
</div>
</div>
<style type="text/css">
#map_canvas img {
   max-width: none;
}
button.close {
padding: 0;
cursor: pointer;
background: transparent;
border: 0;
-webkit-appearance: none;
}
.close {
float: right;
font-size: 20px;
font-weight: bold;
line-height: 18px;
color: #000000;
text-shadow: 0 1px 0 #ffffff;
opacity: 0.2;
filter: alpha(opacity=20);
}
h3 {
display: block;
margin: 0;
font-family: 'Karla', sans-serif;
font-weight: bold;
color: #0088CC;
text-rendering: optimizelegibility;
}
.hide {
display: none;
}
.modal-header {
padding: 9px 15px;
border-bottom: 1px solid #eee;
}
.modal.fade {
-webkit-transition: opacity .3s linear, top .3s ease-out;
-moz-transition: opacity .3s linear, top .3s ease-out;
-ms-transition: opacity .3s linear, top .3s ease-out;
-o-transition: opacity .3s linear, top .3s ease-out;
transition: opacity .3s linear, top .3s ease-out;
}
.modal.fade.in {
top: 50%;
}
.fade.in {
opacity: 1;
}
.modal {
position: fixed;
top: 50%;
left: 60%;
z-index: 1050;
overflow: auto;
width: 560px;
margin: -250px 0 0 -280px;
background-color: #ffffff;
border: 1px solid #999;
border: 1px solid rgba(0, 0, 0, 0.3);
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);
-webkit-background-clip: padding-box;
-moz-background-clip: padding-box;
background-clip: padding-box;
}
.modal-footer {
padding: 14px 15px 15px;
margin-bottom: 0;
text-align: right;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
-webkit-border-radius: 0 0 6px 6px;
-moz-border-radius: 0 0 6px 6px;
border-radius: 0 0 6px 6px;
-webkit-box-shadow: inset 0 1px 0 #ffffff;
-moz-box-shadow: inset 0 1px 0 #ffffff;
box-shadow: inset 0 1px 0 #ffffff;
}

</style>
<script src="http://api.map.baidu.com/api?v=1.2"></script>
<div class="modal hide fade" id="myModal">
        <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" style="color:red;">×</button>
                <h3>选择地图坐标</h3>
        </div>
        <div class="modal-body" id="map_canvas" style="width:560px; height:300px;">

        </div>

</div>
</div>
<script type="text/javascript">
	var map = new BMap.Map('map_canvas', {defaultCursor: 'default'});
	map.centerAndZoom(new BMap.Point(111.413345, 41.910584), 7);
	map.addControl(new BMap.NavigationControl());  //添加默认缩放平移控件
	map.addControl(new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL}));  //右上角，仅包含平移和缩放按钮
	map.addControl(new BMap.NavigationControl({anchor: BMAP_ANCHOR_BOTTOM_LEFT, type: BMAP_NAVIGATION_CONTROL_PAN}));  //左下角，仅包含平移按钮
	map.addControl(new BMap.NavigationControl({anchor: BMAP_ANCHOR_BOTTOM_RIGHT, type: BMAP_NAVIGATION_CONTROL_ZOOM}));  //右下角，仅包含缩放按钮
	
	var TILE_SIZE = 256;
	map.addEventListener('click', function(e){
		var info = new BMap.InfoWindow('', {width: 260});
		var projection = this.getMapType().getProjection();
		var listGeo = new BMap.Geocoder();
		
		var lngLat = e.point;  
		var lngLatStr = "经纬度：" + lngLat.lng + ", " + lngLat.lat;
		
		var worldCoordinate = projection.lngLatToPoint(lngLat);
		var worldCoordStr = "<br />平面坐标：" + worldCoordinate.x + ", " + worldCoordinate.y;
		
		var pixelCoordinate = new BMap.Pixel(Math.floor(worldCoordinate.x * Math.pow(2, this.getZoom() - 18)), 
		                               Math.floor(worldCoordinate.y * Math.pow(2, this.getZoom() - 18)));
		var pixelCoordStr = "<br />像素坐标：" + pixelCoordinate.x + ", " + pixelCoordinate.y;
		
		var tileCoordinate = new BMap.Pixel(Math.floor(pixelCoordinate.x / 256),
		                         Math.floor(pixelCoordinate.y / 256));
		var tileCoordStr = "<br />图块坐标：" + tileCoordinate.x + ", " + tileCoordinate.y;
		
		var viewportCoordinate = map.pointToPixel(lngLat);
		var viewportCoordStr = "<br />可视区域坐标：" + viewportCoordinate.x + ", " + viewportCoordinate.y;
		
		var overlayCoordinate = map.pointToOverlayPixel(lngLat);
		var overlayCoordStr = "<br />覆盖物坐标：" + overlayCoordinate.x + ", " + overlayCoordinate.y;
		
		info.setContent(lngLatStr + worldCoordStr + pixelCoordStr + tileCoordStr + 
		          viewportCoordStr + overlayCoordStr);
		map.openInfoWindow(info, lngLat);
		
		// 获取地理位置信息
		listGeo.getLocation(lngLat, function(result){
//			document.getElementById('address').value = result.address;
                        document.getElementById('lng').value = lngLat.lng;	
			document.getElementById('lat').value = lngLat.lat;		
		});
		
	});
</script>
<script type="text/javascript">
$(document).ready(function(){
	
	$(".showdiv").click(function(){
	
		var box =300;
		
		var th= $(window).scrollTop()+$(window).height()/1.6-box;
		
		var h =document.body.clientHeight;
		
		var rw =$(window).width()/2-box;
		
		$("#myModal").animate({top:th,opacity:'show',width:600,height:340,right:rw},500);
		
		$("body").prepend("<div class='mask'></div>");
		
		$(".mask").css({opacity:"0.5"}).css("height",h);
		
		return false;
		
	});
	
	$("#myModal .close").click(function(){
	
		$(this).parents("#myModal").animate({top:0,opacity: 'hide',width:0,height:0,right:0},500);
		
		$(".mask").fadeOut("fast");
		
	});
	
});
</script>

</body>
</html>
